class searchCommon {
	constructor(name) { //构造函数
		this.name = name;
	}

	addEasyUILayout() { //添加easyui-layout控件
		var bodyContent = "<div class=\"easyui-layout\" style=\"width:100%;height:640px;\"><div data-options=\"region:'north'\" style=\"height:80px;\"><div id=\"p\" class=\"easyui-panel\" title='" + this.name + '查询' + "' style=\"width:100%;height:100%;padding:10px;\"><table cellspacing=\"4\"><tr id=\"searchArea\"></tr></table></div></div><div data-options=\"region:'center'\"><div class=\"easyui-tabs\" id=\"div_tabs\" style=\"width: 100%\"></div></div></div>";
		$("body").append(bodyContent);
	}

	addSearchCondition(objInfo) { //用于添加search中的查询条件
		var _title = objInfo._title || "";
		var _class = objInfo._class || "";
		var _id = objInfo._id || "";
		var _name = objInfo._name || "";
		var _dataoptions = objInfo._dataoptions || "";
		var searchContent = "<td>" + _title + "</td><td><input id='" + _id + "' name='" + _name + "' class='" + _class + "' data-options='" + objInfo._dataoptions + "' /></td>";
		$("#searchArea").append(searchContent);
	}

	addListCondition(listInfo) { //用于添加search中的list信息
		var _title = listInfo._title || "";
		var _src = listInfo._src || "";
		var _style = listInfo._style || "";
		var listContent = "<div title=" + _title + " style=\"overflow:hidden\"><iframe id=\"ifrmList\" src='" + _src + "' style='" + _style + "' frameborder=\"0\" scrolling=\"no\"></iframe></div>";
		$("#div_tabs").append(listContent);
	}

	//.............................................................以上除了构造函数之外，为单对象添加测试........................................

	//.............................................................以下为json文件测试........................................
	constructBoundary(boundaryFile) {
		//		console.log(boundaryFile[0]);
		//		var searchConditionLength = boundaryFile[0].searchCondition.length;
		//		var listLength = boundaryFile[0].listContent.length;
		for(var search of boundaryFile[0].searchCondition) {
			var _style = search._style || "";
			var _title = search._title || "";
			var _onclick = search._onclick || "";
			switch(search._tagname) {
				case "a":
					var searchContent = "<td><a onClick='" + search._onclick + "' style='" + _style + "' id='" + search._id + "' name='" + search._name + "' class='" + search._class + "' data-options='" + search._dataoptions + "' >" + search._title + "</a></td>";
					break;
				case "input":
					var searchContent = "<td>" + search._title + "</td><td><input style='" + _style + "' id='" + search._id + "' name='" + search._name + "' class='" + search._class + "' data-options='" + search._dataoptions + "' /></td>";
					break;
			}
			$("#searchArea").append(searchContent);
		}
		for(var list of boundaryFile[0].listContent) {
			var listContent = "<div title=" + list._title + " style=\"overflow:hidden\"><iframe id=\"ifrmList\" src='" + list._src + "' style='" + list._style + "' frameborder=\"0\" scrolling=\"no\"></iframe></div>";
			$("#div_tabs").append(listContent);
		}
	}
}